package cn.kgc.springcloud.service.impl;

import cn.kgc.springcloud.entity.City;
import cn.kgc.springcloud.mapper.CityMapper;
import cn.kgc.springcloud.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: mosin
 * @version: v1.0  2022/8/29
 */
@Service
public class CityServiceImpl implements CityService {

    @Autowired
    private CityMapper cityMapper;


    @Override
    public List<City> findAll() {
        List<City> cities =  cityMapper.findAll();
        return cities;
    }

    @Override
    public City addCity(City city) {
        Integer line =  cityMapper.addCity(city);
        System.out.println("line = " + line);
        System.out.println(city);
        return city;
    }

    @Override
    public City getById(Integer cityId) {
        City city =  cityMapper.getById(cityId);
        return city;
    }


}
